3.7 \(\int (1-2 \sin ^2(e+f x)) \, dx\)

Optimal. Leaf size=16 \[ \frac{\sin (e+f x) \cos (e+f x)}{f} \]

[Out]

(Cos[e + f*x]*Sin[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0126719, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {2635, 8} \[ \frac{\sin (e+f x) \cos (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[1 - 2*Sin[e + f*x]^2,x]

[Out]

(Cos[e + f*x]*Sin[e + f*x])/f

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (1-2 \sin ^2(e+f x)\right ) \, dx &=x-2 \int \sin ^2(e+f x) \, dx\\ &=x+\frac{\cos (e+f x) \sin (e+f x)}{f}-\int 1 \, dx\\ &=\frac{\cos (e+f x) \sin (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 0.0080478, size = 33, normalized size = 2.06 \[ \frac{\sin (2 e) \cos (2 f x)}{2 f}+\frac{\cos (2 e) \sin (2 f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[1 - 2*Sin[e + f*x]^2,x]

[Out]

(Cos[2*f*x]*Sin[2*e])/(2*f) + (Cos[2*e]*Sin[2*f*x])/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 30, normalized size = 1.9 \begin{align*} x-2\,{\frac{-1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1-2*sin(f*x+e)^2,x)

[Out]

x-2/f*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)

________________________________________________________________________________________

Maxima [A]  time = 0.939203, size = 35, normalized size = 2.19 \begin{align*} x - \frac{2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1-2*sin(f*x+e)^2,x, algorithm="maxima")

[Out]

x - 1/2*(2*f*x + 2*e - sin(2*f*x + 2*e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.63091, size = 39, normalized size = 2.44 \begin{align*} \frac{\cos \left (f x + e\right ) \sin \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1-2*sin(f*x+e)^2,x, algorithm="fricas")

[Out]

cos(f*x + e)*sin(f*x + e)/f

________________________________________________________________________________________

Sympy [A]  time = 0.370381, size = 49, normalized size = 3.06 \begin{align*} x - 2 \left (\begin{cases} \frac{x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{\sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \sin ^{2}{\left (e \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1-2*sin(f*x+e)**2,x)

[Out]

x - 2*Piecewise((x*sin(e + f*x)**2/2 + x*cos(e + f*x)**2/2 - sin(e + f*x)*cos(e + f*x)/(2*f), Ne(f, 0)), (x*si
n(e)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.11331, size = 20, normalized size = 1.25 \begin{align*} \frac{\sin \left (2 \, f x + 2 \, e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1-2*sin(f*x+e)^2,x, algorithm="giac")

[Out]

1/2*sin(2*f*x + 2*e)/f